package com.yupi.longojbackendjudgeservice.controller.inner;

import com.yupi.longojbackendjudgeservice.judge.JudgeService;
import com.yupi.longojbackendmodel.entity.QuestionSubmit;
import com.yupi.longojbackendmodel.enums.QuestionSubmitStatusEnum;
import com.yupi.longojbackendserviceclient.service.JudgeFeignClient;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/inner")
public class JudgeInnerController implements JudgeFeignClient {
    @Autowired
    private JudgeService judgeService;
    /**
     * 执行判题
     * @param questionSubmitId
     * @return
     */
    @Override
    @PostMapping("/do")
    public QuestionSubmit doJudge(@RequestParam("questionSubmitId") Long questionSubmitId){
      return   judgeService.doJudge(questionSubmitId);
    }
}
